import React from 'react'

const Home = React.lazy(() => import('../pages/home'))
const Car = React.lazy(() => import('../pages/car'))
const Classify = React.lazy(() => import('../pages/classify'))
const Detail = React.lazy(() => import('../pages/detail'))
const Layout = React.lazy(() => import('../pages/layout'))
const My = React.lazy(() => import('../pages/my'))


export const childrenRoutes = [{
	path: '/',
	title: '首页',
	element: <Home></Home>
},{
	path: '/classify',
	title: '分类',
	element: <Classify></Classify>
},{
	path: '/car',
	title: '购物车',
	element: <Car></Car>
},{
	path: '/my',
	title: '我的',
	element: <My></My>
}]

export const routes = [{
	path: '/',
	element: <Layout></Layout>,
	children: childrenRoutes
},{
	path: '/detail/:id',
	element: <Detail></Detail>
}]